package com.controller;

import com.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created by
 *
 * @author touni
 * @date 2019/4/11
 * @time 18:26
 */
@RestController
public class UserController {

    @Autowired
    private IUserService userService;


    @GetMapping("/user/{id}")
    public Object queryById(@PathVariable Integer id){
        if (null == id){
            return "参数非法";
        }
        /*try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/

        return userService.queryByuserId(id);


    }





}
